#ifndef _TTY_IO_HPP
#define _TTY_IO_HPP

#include <string>
#include <stdint.h>
#include <termios.h>

#include "interface.hpp"
#include "fingerprint.hpp"

/* Open and Initialize serial device */
void open_serial_device(std::string port);

void rt_write(const std::string port, b_packet_t* req);
b_packet_t* rt_send_request(const std::string port, b_packet_t* req);

/* send request to fingerprint and get the response */
fp_packet_t fp_send_request(const fp_packet_t req);

/* send broadcast msg to fingerprint */
void fp_send_bcast_msg(const fp_packet_t req);

/* Write to GSM */
int gsm_write(char *chars);

/* Read from GSM */
int gsm_read(char *result);

#endif //_TTY_IO_HPP
